package appConfig

import (
	"github.com/spf13/viper"
)

type AppConfig struct {
	Mysql
	Redis
	AliPay
}

type Mysql struct {
	User     string
	Passwd   string
	Host     string
	Port     int64
	Database string
}

type Redis struct {
	Addr   string
	Passwd string
}

type AliPay struct {
	AppId      string
	PrivateKey string
}

var ConfigData AppConfig

func Init() {
	viper.SetConfigFile("appConfig/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&ConfigData)
}
